<?php echo form_open_multipart(uri_string())?>    
    <table class="form">
        <tr>
            <td class="required label" style="width: 150px;"><?php echo lang('full_name');?></td>
            <td><input type="text" name="lb_full_name" id="lb_full_name"class="w250" value="<?php echo $rs->lb_full_name;?>"></td>
        </tr> 
             
        <tr>
            <td class="required label" style="width: 150px;"><?php echo lang('email');?></td>
            <td><input type="text" name="lb_email" id="lb_email"class="w150" value="<?php echo $rs->lb_email;?>"></td>
        </tr>
        <tr>
            <td class="required label" style="width: 150px;"><?php echo lang('password');?></td>
            <td><input type="password" name="lb_password" id="lb_password"class="w150" value="<?php echo $rs->lb_password;?>"></td>
        </tr>
        <tr>
            <td class="required label" style="width: 150px;"><?php echo lang('gender');?></td>
            <td>
                <input <?php echo ($rs->nb_gender==1)?'checked=true':'';?> type="radio"  value="1" id="nb_gender_male" name="nb_gender" tabindex="6"><?php echo lang('male');?>
                <input <?php echo ($rs->nb_gender==-1)?'checked=true':'';?> type="radio"  value="-1" id="nb_gender_female" name="nb_gender" tabindex="6"><?php echo lang('female');?>
            </td>
        </tr>  
        <tr>
            <td class="required label" style="width: 150px;"><?php echo lang('birth_day');?></td>
            <td>
                <select id="lb_day" name="lb_day">
                    <option value="">Day</option>
                    <?php
                        for($i=1;$i<=31;$i++){
                            echo  '<option '.(($rs->lb_day==$i)?"selected=true":"").' value="'.$i.'">'.$i.'</option>';
                        }
                    ?>
                </select>
                <select id="lb_month" name="lb_month">
                    <option value="">Month</option>
                    <?php
                        for($i=1;$i<=12;$i++){
                            echo  '<option '.(($rs->lb_month==$i)?"selected=true":"").' value="'.$i.'">'.$i.'</option>';
                        }
                    ?>
                </select>
                <select id="lb_year" name="lb_year">
                    <option value="">year</option>
                    <?php
                        for($i=2012;$i>=1951;$i--){
                            echo  '<option '.(($rs->lb_year==$i)?"selected=true":"").' value="'.$i.'">'.$i.'</option>';
                        }
                    ?>
                </select>
            </td>
        </tr> 
        <tr>
            <td class="label" style="width: 150px;"><?php echo lang('phone');?></td>
            <td><input type="text" name="lb_phone" id="lb_phone"class="w150" value="<?php echo $rs->lb_phone;?>"></td>
        </tr>
        <tr>
            <td class="label" style="width: 150px;"><?php echo lang('address');?></td>
            <td><input type="text" name="lb_address" id="lb_address"class="w350" value="<?php echo $rs->lb_address;?>"></td>
        </tr>
       
        <tr>
            <td class="label"><?php echo lang('active_deactive');?></td>
            <td><input type="checkbox" name="bl_active" id="bl_active" <?php if($rs->bl_active==1) echo 'checked'; ?> value="<?php echo $rs->bl_active;?>"  onclick="setCheckboxValue(this);"></td>
        </tr>
        
        <tr>
            <td class="label"><?php echo lang('last_login');?></td>
            <td><input type="text" readonly name="dt_last_login" id="dt_last_login" value="<?php echo $rs->dt_last_login;?>"></td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                <input type="submit" name="bt_submit" value="" class="capnhat">
            </td>
        </tr>  
    </table>
<?php echo form_close()?>
<script type="text/javascript" language="javascript">
        $(document).ready(function(){
        new AjaxUpload($('#upload_avatar'),{
            action:'<?php echo base_url();?>user/settings_upload_avatar',
            name: 'uploadfile',
            data: {
                member_id:$("#member_id").val(),
                lb_image:$('#lb_image').val()
            },onSubmit: function(file, ext){
                 if (! (ext && /^(jpg|png|jpeg|gif|)$/.test(ext))){
                    // extension is not allowed
                    $('#status_message').text('Allow JPG, PNG, JPEG, GIF');
                    return false;
                }
                $('#status_message').text('Uploading. Please wait ...');
            },onComplete: function(file, response){
                //On completion clear the status
                $('#status_message').text('');
                //Add uploaded file to list
                if(response!="error")
				{
					var data = $.parseJSON(response) ;
					//$("#avatar").html('<img src="' + site + 'uploads/100/' + data.img + '" width="100" height="100" />') ;
                    document.getElementById('avatar_img').src = '<?php echo base_url_site();?>uploads/avatar/135/'+data.img;
					$("#lb_image").val(data.img) ;

                }else{

                }
            }
        });
    });

</script>

